#include "widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , lineEdit(new QLineEdit(this))
{
    layout = new QGridLayout(this);
    setLayout(layout);
    layout->addWidget(lineEdit, 0, 0);
    QStringList strlist = {"U盘启动工具", "UU加速器", "UUUID识别"};
    c = new QCompleter(strlist, this);
    c->setCaseSensitivity(Qt::CaseInsensitive);
    lineEdit->setCompleter(c);
    lineEdit->setText("输入u弹出Completer窗口");

    QPushButton *btn = new QPushButton("调整大小", this);
    layout->addWidget(btn, 1, 0);
    connect(btn, &QPushButton::clicked, this, [=]() {
        if (width() >= 640)
            setGeometry(640, 480, 320, 240);
        else
            setGeometry(320, 240, 640, 480);
    });
}

Widget::~Widget()
{
}